]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
popupMenu: fix relayout after submenu open/close
authorDan Winship <danw@gnome.org>
Fri, 25 Mar 2011 14:14:55 +0000 (10:14 -0400)
committerDan Winship <danw@gnome.org>
Fri, 25 Mar 2011 22:55:06 +0000 (18:55 -0400)
Because of the GtkSizeGroup-like trickiness we're doing with
PopupMenuItems, we need to force Clutter to discard its cached size
requests for them any time the menu itself changes size.

https://bugzilla.gnome.org/show_bug.cgi?id=645647

js/ui/popupMenu.js

index 97a9c4d7f854a3171ea9bd8fe0981653c544bcf9..fc6140569e3a961f8c4a2a355eca10ad6de91d5a 100644 (file)
@@ -765,6 +765,7 @@ PopupMenuBase.prototype = {
         } else {
             this.box = new St.BoxLayout({ vertical: true });
         }
+        this.box.connect_after('queue-relayout', Lang.bind(this, this._menuQueueRelayout));
 
         this.isOpen = false;
 
@@ -893,6 +894,16 @@ PopupMenuBase.prototype = {
         }
     },
 
+    // Because of the above column-width funniness, we need to do a
+    // queue-relayout on every item whenever the menu itself changes
+    // size, to force clutter to drop its cached size requests. (The
+    // menuitems will in turn call queue_relayout on their parent, the
+    // menu, but that call will be a no-op since the menu already
+    // has a relayout queued, so we won't get stuck in a loop.
+    _menuQueueRelayout: function() {
+        this.box.get_children().map(function (actor) { actor.queue_relayout(); });
+    },
+
     addActor: function(actor) {
         this.box.add(actor);
     },